<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="cake.dao.OrderDetailDao"%>
<%@page import="cake.db.MySqlDb"%>
<%@page import="java.sql.ResultSet"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>Update Diy picture</title>
		<link rel="stylesheet" href="styles/style.css" type="text/css" />
		<script src="scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
		<script src="scripts/jquery.select.js" type="text/javascript"></script>
		<script src="scripts/tools.js" type="text/javascript"></script>
		<script src="scripts/script.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="container">
			<div id="header">
				<div id="header_left">
					<img src="images/logo.png" alt="cake"  class="logo"/>
				</div>
				<div style="padding-top: 20px;">
					<input type="text" id="keywords" name="keywords" />
					<input type="image" id="search" src="images/search.jpg" value="search"  onclick="search();"/>
					<span class=" btn" style="margin-left: 50px;"> <%
 	String username = null;
 	long userid = 0;
 	username = (String) session.getAttribute("username");
 	String tempS=(String)session.getAttribute("userid");
 	userid = Long.parseLong(tempS);
 	if (username == null || username.equals("")) {
 		response.sendRedirect("login.jsp");
 	} else {
 %> Welcome: <%=username%> &nbsp;&nbsp;&nbsp;&nbsp; <span
						class="pointer" onclick="toURL('myOrder.jsp')">MyOrders |</span>
						<span class="pointer" onclick="quit();">Quit</span> <%
 	}
 %> </span>
 <span style="margin-left:20px;cursor:pointer;" onclick="toURL('msgBoard.jsp');">MsgBoard</span>
				</div>
				<div id="navigation">
					<ul>
						<li><a href="index.jsp">Home</a> |</li>
						<li><a href="cakes.jsp">Reservation</a> |</li>
						<li><a href="advanced.jsp">Advanced Reservation</a> |</li>
						<li><a href="cakes.jsp?category=5">New Products</a> |</li>
						<%
						String id=request.getParameter("id");
						if(id==null || id.equals(""))
						{
							response.sendRedirect("login.jsp");	
						}
						
						if(username==null || username.equals(""))
						{
						%>
						<li><a href="login.jsp">MyOrders</a> |</li>
						<li><a href="login.jsp">Shopping Cart</a> |</li>
						<%
						}
						else
						{
						%>
						<li><a href="myOrder.jsp">MyOrders</a> |</li>
						<li><a href="shoppingCart.jsp">Shopping Cart</a> |</li>
						<%
						}
						%>
						<li><a href="about.jsp">About us</a></li>
					</ul>
				</div>
			</div>
			<div id="content">
				<div style="margin-left: 35px;">
					<div>
						Location：
						<a href="index.jsp">Home</a> &gt; <a href="myOrder.jsp">My Orders</a> &gt; Update Picture
					</div>
					<form name="upload_form" id="upload_form" action="UserServlet?action=updatePicture" method="POST" enctype="multipart/form-data"  target="hidden_frame">
						<div id="require">
							<input type="file" name="pic_path" id="pic_path"/> 
							<iframe name='hidden_frame' id="hidden_frame" style="display:none"></iframe>
						</div>
						<div id="confirm_diy">
							<%
			    				if(username==null || username.equals(""))
			    				{
							%>
								<input type="button" value="" class="submit" onclick="toURL('admin.jsp');" />
							<%
			    				}
			    				else
			    				{
							%>
								<input type="button" value="" class="submit" onclick="updatePicture(<%=id %>);" />
							<%
			    				}
							%>
							<input type="button" value="" class="reset" onclick="toURL('myOrder.jsp');"/>
						</div>
					</form>
				</div>
				<div id="categorys">
					<%@include file="footer.jsp" %>
				</div>
			</div>
		</div>
	</body>
</html>
